package com.example.chat

import com.example.chat.dao.MessageDao
import com.example.chat.dao.TopicDao
import com.example.chat.dao.TopicParticipantDao
import com.example.featuresdk.dao.UserDao
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
class ChatHiltModule {

    @Provides
    @Singleton
    fun callback(topicDao: TopicDao,
                 topicParticipantDao: TopicParticipantDao,
                 messageDao: MessageDao,
                 userDao: UserDao
    )
    = ChatDatabaseCallback(topicDao, topicParticipantDao, messageDao, userDao)

    @Provides
    @Singleton
    fun featureSdk(featureService: TopicFeatureService) = ChatFeatureSDK()

    @Provides
    fun featureService(topicDao: TopicDao) = TopicFeatureService(topicDao)
}